package com.itwn.portal.web;
import com.itwn.portal.entity.Tag;
import com.itwn.portal.service.TagService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;

@RestController
@RequestMapping("tag")
public class TagController {
    @Autowired
    TagService tagService;
    
    @RequestMapping ("/list")
    public List<Tag> listAll(){
        return this.tagService.queryAll();
    }

    @RequestMapping("/getTagName")
    @ResponseBody
    public String getTagName(Integer id){
        System.out.println("查询标签名；；；；；；；；；；"+id);
        String str = this.tagService.queryName(id);
        System.out.println("查询标签名；；；；；；；；；；"+str);
        return str;
    }

}
